cr	equ	0dh
lf	equ	0ah
	org	100h
Start:	jmp	Begin
Msg1	db	'Vvedite pervoe chislo i najmite Enter:', cr, lf, '$'
Msg2	db	'Vvedite vtoroe chislo i najmite Enter:', cr, lf, '$'
Msg3	db	'Pervoe na vtoroe, net', cr, lf, '$'
Msg4	db	'Pervoe na vtoroe, da', cr, lf, '$'
Msg5	db	'Vtoroe na pervoe, net', cr, lf, '$'
Msg6	db	'Vtoroe na pervoe, da', cr, lf, '$'
MsgErr	db	'Oshibka!!!', cr, lf, '$'
NumbArr	times	2	dw	0
;IndArr	dw	0
MStr1	db	4
LStr1   db	0
StrNumb1 times	4	db	0
MStr2	db	4
LStr2   db	0
StrNumb2 times	4	db	0
Begin:
	mov	ah,09h
	mov	dx,Msg1
	int	21h
	mov	ah,0ah
	mov	dx,MStr1
	int	21h
	mov	ah,02h
	mov	dl,0ah
	int	21h
	cmp	[LStr1],byte 0
	jz	.Err

 	xor	ax,ax
	xor	bx,bx
	xor	cx,cx
	xor	dx,dx
	xor	si,si
	mov	cl,[LStr1]
	mov	bl,10
.L1:	mov	dl,[StrNumb1+si]
	inc	si
	cmp	dl,39h
	ja	.Err
	cmp	dl,30h
	jb	.Err
	cmp	dl,30h
	jne	.M1
	cmp	si,1
	je	.Err
.M1:	mul	bl
	sub	dl,30h
	add	al,dl
	loop	.L1
	mov	[NumbArr],ax

	mov	ah,09h
	mov	dx,Msg2
	int	21h
	mov	ah,0ah
	mov	dx,MStr2
	int	21h
	mov	ah,02h
	mov	dl,0ah
	int	21h
	cmp	[LStr2],byte 0
	jz	.Err

 	xor	ax,ax
	xor	bx,bx
	xor	cx,cx
	xor	dx,dx
	xor	si,si
	mov	cl,[LStr2]
	mov	bl,10
.L2:	mov	dl,[StrNumb2+si]
	inc	si
	cmp	dl,39h
	ja	.Err
	cmp	dl,30h
	jb	.Err
	cmp	dl,30h
	jne	.M2
	cmp	si,1
	je	.Err
.M2:	mul	bl
	sub	dl,30h
	add	al,dl
	loop	.L2
	mov	[NumbArr+2],ax

	xor	dx,dx
	mov	ax,[NumbArr]
	mov	bx,[NumbArr+2]
	div	bx
	cmp	dx,0
	je	.N1
	mov	dx,Msg3
	jmp	.N2
.N1:	mov	dx,Msg4
.N2:	mov	ah,09h
	int	21h
	
	xor	dx,dx
	mov	ax,[NumbArr+2]
	mov	bx,[NumbArr]
	div	bx
	cmp	dx,0
	je	.N3
	mov	dx,Msg5
	jmp	.N4
.N3:	mov	dx,Msg6
.N4:	mov	ah,09h
	int	21h
  
	jmp	.Exit
.Err:	mov	ah,09h
	mov	dx,MsgErr
	int	21h
.Exit:	mov	ax,4c00h
	int	21h
